<template>
	<view class="load-view"><view class="goto" @click="goto">跳过</view></view>
</template>

<script>
import { mapState } from 'vuex';
export default {
	data() {
		return {};
	},
	onLoad() {
		// if (this.userInfo.Authorization) {
		// 	uni.switchTab({
		// 		url: '/pages/index/index'
		// 	});
		// } else {
		// 	this.$store.commit('logout');
		// 	uni.reLaunch({
		// 		url: '/pages/login/login'
		// 	});
		// }
	},
	onShow() {
		if (this.userInfo.Authorization) {
			uni.switchTab({
				url: '/pages/index/index'
			});
		} else {
			this.$store.commit('logout');
			uni.reLaunch({
				url: '/pages/login/login'
			});
		}
	},
	computed: {
		...mapState(['userInfo'])
	},
	methods: {
		goto() {
			if (this.userInfo.Authorization) {
				uni.switchTab({
					url: '/pages/index/index'
				});
			} else {
				this.$store.commit('logout');
				uni.reLaunch({
					url: '/pages/login/login'
				});
			}
		}
	}
};
</script>

<style lang="scss">
.load-view {
	height: 100%;

	.goto {
		position: absolute;
		right: 30rpx;
		bottom: 30rpx;
		padding: 0 20rpx;
		font-size: 28rpx;
		color: #fff;
		border-radius: 40rpx;
		border: 1rpx solid;
	}

	image {
		width: 100%;
		height: 100%;
	}
}
</style>
